ContentType

interface ContentType

A parsed Content-Type header value.

Since

7.33

Types

Link copied to clipboard
class Builder
A builder of ContentType.

Properties

Link copied to clipboard

The boundary specified in this ContentType, if any.

Link copied to clipboard

The charset specified in this ContentType, if any.

Functions

Link copied to clipboard
open fun boundary(): Optional<String>
Returns the boundary specified in the Content-Type header or an empty Optional if the header does not contain a boundary.
Link copied to clipboard
open fun charset(): Optional<String>
Returns the charset specified in the Content-Type header or an empty Optional if the header does not contain a charset.
Link copied to clipboard
open fun mediaType(): String
Returns the media type (the MIME type) specified in the Content-Type header.
Link copied to clipboard
open fun newBuilder(mediaType: String): ContentType.Builder
Create a new ContentType builder.